import { Button } from "std-widgets.slint";
export component Alter inherits Rectangle {
    in-out property <bool> btn-open: false;
    in property <string> message;

    width: 300px;
    height: 200px;
    background: #eee;
    border-color: #ccc;
    border-width: 1px;
    border-radius: 5px;
    z: 10;

    callback cancel(bool);

    HorizontalLayout {
        alignment: LayoutAlignment.center;
        VerticalLayout {
            spacing: 8px;
            alignment: LayoutAlignment.center;
            Text {
                text: message;
                font-size: 24px;
            }

            Button {
                height: 36px;
                text: "确认";
                visible: btn-open;
                clicked => {
                    root.cancel(true);
                }
            }
        }
    }
}
